﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeClipBoundary2d : OdGeEntity2d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeClipBoundary2d(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeClipBoundary2d_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeClipBoundary2d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeClipBoundary2d()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeClipBoundary2d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeClipBoundary2d() : this(GlobalsPINVOKE.new_OdGeClipBoundary2d__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeClipBoundary2d(OdGePoint2d cornerA, OdGePoint2d cornerB) : this(GlobalsPINVOKE.new_OdGeClipBoundary2d__SWIG_1(OdGePoint2d.getCPtr(cornerA), OdGePoint2d.getCPtr(cornerB)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeClipBoundary2d(OdGePoint2dArray clipBoundary) : this(GlobalsPINVOKE.new_OdGeClipBoundary2d__SWIG_2(OdGePoint2dArray.getCPtr(clipBoundary).Handle), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeClipBoundary2d(OdGeClipBoundary2d src) : this(GlobalsPINVOKE.new_OdGeClipBoundary2d__SWIG_3(OdGeClipBoundary2d.getCPtr(src)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGe.ClipError set(OdGePoint2d cornerA, OdGePoint2d cornerB)
		{
			OdGe.ClipError result = (OdGe.ClipError)GlobalsPINVOKE.OdGeClipBoundary2d_set__SWIG_0(this.swigCPtr, OdGePoint2d.getCPtr(cornerA), OdGePoint2d.getCPtr(cornerB));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGe.ClipError set(OdGePoint2dArray clipBoundary)
		{
			OdGe.ClipError result = (OdGe.ClipError)GlobalsPINVOKE.OdGeClipBoundary2d_set__SWIG_1(this.swigCPtr, OdGePoint2dArray.getCPtr(clipBoundary).Handle);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGe.ClipError clipPolygon(OdGePoint2dArray rawVertices, OdGePoint2dArray clippedVertices, ref OdGe.ClipCondition clipCondition, OdIntArray pClippedSegmentSourceLabel)
		{
			OdGe.ClipError result = (OdGe.ClipError)GlobalsPINVOKE.OdGeClipBoundary2d_clipPolygon__SWIG_0(this.swigCPtr, OdGePoint2dArray.getCPtr(rawVertices).Handle, OdGePoint2dArray.getCPtr(clippedVertices).Handle, ref clipCondition, OdIntArray.getCPtr(pClippedSegmentSourceLabel));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGe.ClipError clipPolygon(OdGePoint2dArray rawVertices, OdGePoint2dArray clippedVertices, ref OdGe.ClipCondition clipCondition)
		{
			OdGe.ClipError result = (OdGe.ClipError)GlobalsPINVOKE.OdGeClipBoundary2d_clipPolygon__SWIG_1(this.swigCPtr, OdGePoint2dArray.getCPtr(rawVertices).Handle, OdGePoint2dArray.getCPtr(clippedVertices).Handle, ref clipCondition);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGe.ClipError clipPolyline(OdGePoint2dArray rawVertices, OdGePoint2dArray clippedVertices, ref OdGe.ClipCondition clipCondition, OdIntArray pClippedSegmentSourceLabel)
		{
			OdGe.ClipError result = (OdGe.ClipError)GlobalsPINVOKE.OdGeClipBoundary2d_clipPolyline__SWIG_0(this.swigCPtr, OdGePoint2dArray.getCPtr(rawVertices).Handle, OdGePoint2dArray.getCPtr(clippedVertices).Handle, ref clipCondition, OdIntArray.getCPtr(pClippedSegmentSourceLabel));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGe.ClipError clipPolyline(OdGePoint2dArray rawVertices, OdGePoint2dArray clippedVertices, ref OdGe.ClipCondition clipCondition)
		{
			OdGe.ClipError result = (OdGe.ClipError)GlobalsPINVOKE.OdGeClipBoundary2d_clipPolyline__SWIG_1(this.swigCPtr, OdGePoint2dArray.getCPtr(rawVertices).Handle, OdGePoint2dArray.getCPtr(clippedVertices).Handle, ref clipCondition);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeClipBoundary2d Assign(OdGeClipBoundary2d src)
		{
			OdGeClipBoundary2d result = new OdGeClipBoundary2d(GlobalsPINVOKE.OdGeClipBoundary2d_Assign(this.swigCPtr, OdGeClipBoundary2d.getCPtr(src)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
